# Import Module
from tkinter import *

# create root window
root = Tk()

# root window title and dimension
root.title("tkinter学习")
# Set geometry(widthxheight)
root.geometry('800x600')

#这些是按钮内部的padding（文本到边框的距离，设置了后按钮会变大）
paddingX = 20
paddingY = 5
btn1 = Button(root, text="点击我",padx=paddingX,pady=paddingY)
btn2 = Button(root, text="点击我",padx=paddingX,pady=paddingY)
btn3 = Button(root, text="点击我",padx=paddingX,pady=paddingY)
btn4 = Button(root, text="点击我",padx=paddingX,pady=paddingY)
btn5 = Button(root, text="点击我",padx=paddingX,pady=paddingY)
btn6 = Button(root, text="点击我",padx=paddingX,pady=paddingY)

#在grid()中设置按钮之间的间距
grid_gap_X = 10
grid_gap_Y = 30
btn1.grid(column=0, row=0,padx=grid_gap_X,pady=grid_gap_Y)
btn2.grid(column=1, row=0,padx=grid_gap_X,pady=grid_gap_Y)
btn3.grid(column=2, row=0,padx=grid_gap_X,pady=grid_gap_Y)
btn4.grid(column=0, row=1,padx=grid_gap_X,pady=grid_gap_Y)
btn5.grid(column=1, row=1,padx=grid_gap_X,pady=grid_gap_Y)
btn6.grid(column=2, row=1,padx=grid_gap_X,pady=grid_gap_Y)

# Execute Tkinter
root.mainloop()
